package com.ihighest.app.infox.tools;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 将时间戳转换为固定格式
 * 
 * @author lkx Created at 2015-10-20 下午7:12:38
 * @version 1.0
 */
public class LongTimeForData {
	public static String transferLongToDate(Long millSec) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		Date date = new Date(millSec);
		return sdf.format(date);
	}

	public static String transferLongToDate(Long millSec, String format) {
		SimpleDateFormat sdf = new SimpleDateFormat(format);
		Date date = new Date(millSec);
		return sdf.format(date);
	}
}
